//管理员第三层
const { adminsModel } = require('./models/adminsModel');

//管理员登录
module.exports.adminsLogin = async (a) => {
    const data = await adminsModel.find(a)
    return data
}

module.exports.getAdmins = async (params) => {
    return await adminsModel.find();
}

module.exports.addAdmin = async (params) => {
    // console.log(45687,params);
    return await adminsModel.create(params);

}

module.exports.delAdmin = async params => {
    return await adminsModel.deleteOne(params);
}

module.exports.getAdminById = async params => {
    return await adminsModel.find(params);
}

module.exports.updateAdmin = async params => {
    // console.log({ _id: params._id });
    return await adminsModel.updateOne({ _id: params._id }, params);
}
